const Router = require('@koa/router')
const { server } = require('../env')
const auth = require('../middleware/auth')
const { uploadAvatar, verifyAvatar } = require('../middleware/file.middleware')
const fileController = require('../controller/file.controller')

const fileRouter = new Router({ prefix: `${server.pathPrefix}/file` })

fileRouter.post('/avatar', auth, uploadAvatar, verifyAvatar, fileController.uploadAvatar) // 头像上传

module.exports = fileRouter